Skip to content

build: generate bindings from the Frida devkit - #3

Merged
AbhiTheModder merged 14 commits into
mainfrom
devkit-bindgen
Sep 3, 2026
Merged

build: generate bindings from the Frida devkit#3
AbhiTheModder merged 14 commits into
mainfrom
devkit-bindgen

Conversation

@AbhiTheModder

Copy link
Copy Markdown
Owner

No description provided.

AbhiTheModder and others added 14 commits July 20, 2026 23:44
The prebuilt wheel path installs the generated __init__.py,
aio.py and _frida.pyi alongside the extension, not under
build/frida/, so copy them from there.

# Conflicts:
#	setup.py
Skip None values instead of passing them to typed setters.

Map collection kwargs onto their select_/add_ methods, walking
the parent chain. Affects specs, omits, externals, pids and
identifiers.
The .gir rewrite emitted only GObject-derived classes and no
annotations, so py.typed shipped an untyped facade.

Reinstate the aliases as a prelude asset and annotate the facade
from the existing pyi type mapping.

Also fixes read-only options properties and the module functions
missing from _frida.pyi.
The .gir yields only get_device_by_id/by_type, and drops
Cancellable.connect/disconnect, whose callback is not marshallable.

Reinstate all six. connect/disconnect go over the cancelled signal,
keeping g_cancellable_connect's return-0-when-cancelled contract.
Facade on/off took any callable, so misshapen handlers type-checked.

Derive the stacks from the .gir: the alias name follows from the type
and signal name. Undefined aliases and single-signal types are skipped.
Reinstate the cancellable decorator, RPCResult, make_rpc_call_request
and make_auth_callback, and expose ScriptExportsAsync from frida.core
via a new facade_epilogues customization.
The GTlsCertificate-typed properties had no marshaller, so their setters
were never generated. Marshal them to and from a string holding either a
PEM blob or a filename, like the old hand-written bindings did.

Reported and diagnosed by rev1si0n <ihaven0emmail@gmail.com>.
Vala's default argument is absent from the .gir, so the generated facade
made the port mandatory. Declare the default in the customizations, and
let param_typings override the facade signature also when there is no
custom logic.
Its customization hardcoded an empty selector map instead of the one
computed from the options type, so the plural kwarg was rejected. Let
codegen build the options argument for custom facade methods that take
**kwargs.
Sync methods dropped parameters of object type, so PeerOptions.add_relay
never reached the extension even though the facade referred to it.

Constructor kwargs were forwarded to an extension init that ignores them,
leaving them silently unapplied. Apply them to the impl instead, reusing
the options selectors so adders take a list, or a dict when they take a
name and a value.
@AbhiTheModder
AbhiTheModder merged commit 7dcf927 into main Sep 3, 2026
1 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants